/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.sql.*;

public class ManageDB {

  public static Connection connect;

  /**
   * Ouvre la connexion à la BDD
   *
   * @return connect = DriverManager.getConnection()
   * @throws Exception
   */
  public static Connection Open() throws Exception {
	// 1...charger le driver mysql
	Class.forName("com.mysql.jdbc.Driver");
	// 2..creer la conection
	connect = DriverManager.getConnection("jdbc:mysql://localhost/tpscrum", "root", "");
	return connect;
  }

  /**
   * Ferme la connexion à la BDD
   */
  public static void deconnection() {
	try {
	  connect.close();
	} catch (Exception e) {
	}
  }
}
